/**
 * Title:       PlatformService.java
 * Copyright:   Copyright (c) 1996-2004 The Agent Factory Working Group. All rights reserved.
 * Licence:     This file is free software; you can redistribute it and/or modify
 *              it under the terms of the GNU Lesser General Public License as published by
 *              the Free Software Foundation; either version 2.1, or (at your option)
 *              any later version.
 *
 *              This file is distributed in the hope that it will be useful,
 *              but WITHOUT ANY WARRANTY; without even the implied warranty of
 *              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *              GNU Lesser General Public License for more details.
 *
 *              You should have received a copy of the GNU Lesser General Public License
 *              along with Agent Factory; see the file COPYING.  If not, write to
 *              the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 *              Boston, MA 02111-1307, USA.
 */
package com.agentfactory.platform.service;

import java.util.Observable;

import com.agentfactory.platform.core.Agent;

/**
 * This interface outlines the methods that should be implemented by any
 * message transport service.
 *
 * @author  Rem Collier
 */
public abstract class PlatformService extends Observable {
    protected String name;
    private int priority = -1;
    
    public abstract void start();
    public abstract void bind(Agent agent);
    public abstract void unbind(Agent agent);
    public abstract void modifyBinding(String oldName, String name);
    
    public void init(PlatformServiceDescriptor descriptor, PlatformServiceManager manager) {
        priority = descriptor.getPriority();
    }
    
    public int getPriority() {
        return priority;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getName() {
        return name;
    }
    
    public void stop() {
        this.notifyObservers("UnbindService " + name);
    }
}
